﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%namespace YouHP.Model%>
<%namespace YouHP.BLL%>
<%template _Header%>
<script type="text/javascript" src="/support/common/common.js"></script>
<script type="text/javascript" src="/support/alpha/Js/mootools.js"></script>
<link rel="stylesheet" href="/support/common/jquery-ui.css" type="text/css" />
<script type="text/javascript" src="/support/common/jquery.js"></script>
<script type="text/javascript" src="/support/common/ui.core.js"></script>
<script type="text/javascript" src="/support/common/ui.datepicker.js"></script>
<script type="text/javascript" src="/support/common/ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="/support/common/ui.draggable.js"></script> 
<script type="text/javascript" src="/support/common/ui.resizable.js"></script> 
<script type="text/javascript" src="/support/common/ui.dialog.js"></script> 
<script type="text/javascript" src="/support/swfobject/open-flash-chart.js"></script>
<style>
    .symchartcontent {WIDTH: 720px;  TEXT-ALIGN: center; margin:0 auto;}
    .symchartleft { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN: 0px; WIDTH: 60px; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: center;}
    .symchartright { MARGIN: 0px; BACKGROUND-COLOR: #cccccc; TEXT-ALIGN: center; width:650px;}
   ._INDICATOR_TEXT_CONTAINER_ ._indicator_text_ {}
   
   .portrait 
   {
   	    margin: 2px 450px 2px 2px;
   }
   
   .updateEmotionBtn
    {
        background-color:#99CC33;
        border-color:#CCFF99 rgb(102, 153, 0) rgb(102, 153, 0) rgb(204, 255, 153);
        border-style:solid;
        border-width:1px;
        color:#FFFFFF;
        font-size:12px;
        height:20px;
        padding:1px;
        text-align:center;
    }
</style>

 <script type="text/javascript">

function toggleEmotionInput()
{
    var e = _$('EmotionInputDiv').style.display;
    if (e == 'none')
    {
        _$('EmotionInputDiv').style.display = 'block';
        //_$('EmotionDisplayDiv').style.display='none';
        _$('EmotionDisplayDiv').style.color = '#aaaaaa';
    }
    else
    {
        _$('EmotionInputDiv').style.display = 'none';
        //_$('EmotionDisplayDiv').style.display='block';
        _$('EmotionDisplayDiv').style.color = '#EB1539';
    }
}

function enterUpdateEmotionInput(obj)
{
    obj.style.color = '#000000';
    if (obj.value == '随便说上两句...')
        obj.value = '';
    obj.style.borderColor = '#AAAAAA';
}

function UpdateEmotion()
{
    var statusDescription = _$('EmotionInput').value;
    if (statusDescription == "")
        statusDescription = "没什么好说的...";
    
    var emotionTypeIndex = 0;
    var form = _$('emotionTypeSelection');
    for(var i = 0;i < form.elements.length;i++)
    {
      var e = form.elements[i];
      if(e.name == "emotiontype")
      {
         if(e.checked == true)
         {
             emotionTypeIndex = e.value;
             break;
         }
      }
    }   // for
    
    if (statusDescription.length > 50)
    {
        alert("心情描述不能超过50个字!");
        return;
    }
    
    _$('SubmitEmotionBtn').value = "正在处理...";
    
    var aurl = "/Pages/alpha/Ajax/EmotionUpdateAjax.aspx?statusdesc="+statusDescription.escUrl()+"&emotiontypeidx="+emotionTypeIndex;
    var myAjax=new Ajax(aurl,
    {
         method:'post',
         onComplete:function()
         {
              
                  var html=this.response.text;    
                  _$("EmotionDisplayDiv").innerHTML=html;
                  _$("SubmitEmotionBtn").value = "提交";
                  toggleEmotionInput();
          }
    }
   );
   myAjax.request();
}   // UpdateEmotion

</script>

<div class="layout2-cols2">
     <div class="col1">
		<%template _ProfileMenu%>
	</div>
	
<div class="col2">


<div class="box">

      <%template _ProfileHeader%>
    
<div class="content" style="margin-top:10px;">   

<div  class="patientinfo">
<%if UserData.Id==ProfileData.Id%>
<%csharp%>TempUrl = "/User/BasicInfo.aspx";<%/csharp%>
<div style="text-align:right; margin-bottom:5px;" class="editmyprofile"><a href="{GetUrl(TempUrl)}">编辑我的资料</a></div>
<%/if%> 

<table border="0" cellpadding="0" cellspacing="0"  class="patient_table">
    <tr>
        <td>
            <div style="float:left; width:90px; height: 120px; ">
               <%csharp%>TempUrl = "/Profile/index.aspx?uid="+ProfileData.Id;<%/csharp%>
               <a href="{GetUrl(TempUrl)}"><img src="{ProfileData.Avatar}" style="border:1px solid #CACACA; width:80px; height:80px;"/></a>
                <p style="text-align:center;"><a href="javascript:if({UserData.Id}<=0) alert('请先登录！');else showShareUserDialog({ProfileData.Id});"><font style="color:Green; font-size:14px;font-weight:bold;">[分享该用户]</font></a> </p>
            </div>
            
            <div style="float:left; width: 550px; height: 120px;">
               <%csharp%>TempUrl = "/Disease.aspx?id=" + PrData.DiseaseId; <%/csharp%>
            
                <div>
                    <h5>{ProfileData.UserName}<%if PrData.DiseaseId>0%>(<a target="_blank" href="{GetUrl(TempUrl)}"><b>{DiseaseBLL.Instance.GetDiseaseInfo(PrData.DiseaseId).Name}</b></a>)
            
                    <%if ProfileData.Id==UserData.Id%>
                    <%csharp%>TempUrl = "/DiseaseHistory/index.aspx";<%/csharp%>
                    <a href="{GetUrl(TempUrl)}"><font style="font-size:12px;color:#808080;">修改</font></a><%/if%><%/if%><%if IsAdmin>2%><img src="/support/alpha/images/admin_icon.gif" /><%/if%></h5>
                </div>
                
                <!--病友心情-->
                <%csharp%>TempUrl = "/Disease.aspx?id=" + PrData.DiseaseId; <%/csharp%>
                <div style="margin: 0px 0px 0px 20px;background: #ececec">
                    <div id="EmotionDisplayDiv" style="float:left; color:#EB1539" >
                        <img src="{EmotionImgURL}" style="width:30px; height:30px" />
                        <font style="font-size:13px;">{EmotionDescriptionStr}</font>
                     </div>
                     <%if ProfileData.Id==UserData.Id%>
                     <div style="float:right">
                        <input name="UpdateEmotionBtn" id="UpdateEmotionBtn" class="updateEmotionBtn" type="button" value="更新心情" onclick="toggleEmotionInput()" />
                     </div>
                     <%/if%>
                </div>
                
                 <div style="clear:both">
                        <div style="float:left; position:relative">
                            <div id="EmotionInputDiv" style="margin-top: 1px; margin-left:20px; padding-bottom:5px; border:1px solid #98B1C8; position:absolute; width: 400px; display:none; background:#D7DEDB">
                                <!-- 表情列表 -->
                                <form id="emotionTypeSelection" name="emotionTypeSelection">
                                <table>
                                    <tr>
                                        <%csharp%> for (int i=0; i < allEmotionTypes.Count; i ++) { <%/csharp%>
                                        <td width="80">
                                            <table>
                                                <tr height="35"><td align="center"><img src="{allEmotionTypes[i].Img}"/></td></tr>
                                                <tr height="20"><td align="center"><span>{allEmotionTypes[i].Name}</span></td></tr>
                                                <tr height="20"><td align="center"> <input type="radio" class="radio" id="emotiontypeid{i}" name="emotiontype" value="{i}" /></td></tr>
                                            </table>
                                         </td>
                                        <%csharp%> } <%/csharp%>
                                    </tr>
                                </table>
                                </form>
                                <script type="text/javascript">
                                    _$('emotiontypeid0').checked = true;
                                </script>
                                
                                <input name="EmotionInput" style="padding-left:2px; color:rgb(170, 170, 170); width: 350px; height:35px; border:1px solid;" value="随便说上两句..." onfocus="enterUpdateEmotionInput(this);"/>
                                <input name="SubmitEmotionBtn" class="updateEmotionBtn" type="button" value="提交" onclick="UpdateEmotion();"/>
                                <input name="CancelUpdateEmotionBtn" class="updateEmotionBtn" type="button" value="取消" onclick="toggleEmotionInput();"/>
                            </div>
                        </div>
                 </div>
             
                <%csharp%>
				    string province=ProfileData.Province;
				    string city=ProfileData.City;
		        <%/csharp%>
		                
		         <div style="margin: 10px 0px 0px 20px;">
                    <span>基本信息:</span>&nbsp&nbsp;{ProfileData.Gender}
                    <%if ProfileData.Age<=206%>&nbsp;{ProfileData.Age}岁<%/if%> 
                    <%if province!=""||city!=""%>&nbsp;{province}&nbsp;{city}<%/if%>
                 </div>
                
                <%if PrData.DiseaseId>0%>
                    <div style="float:left; margin: 10px 0px 0px 20px"><span>发病/确诊时间:</span>&nbsp;{StartDateStr}/{ConfirmDateStr}&nbsp;&nbsp;&nbsp;
                    <span>确诊医院:</span>&nbsp;<%if PrData.ConfirmHospital!=""%>{PrData.ConfirmHospital}<%else%>未知<%/if%></div>
                    
                <%/if%>
            </div>
                        
        </td>
        
    </tr>

<tr><td>
<div style="float:left;"><span>个人说明：</span></div>
<div style="float:left; width:630px;">
<%if ProfileData.Description!=""%>
{ProfileData.Description}<%else%>暂无
<%/if%>
</div>
</td></tr>
</table>

<table width="700px" cellpadding="0" cellspacing="0">
<tr>
<td>
<span>历史访问量：</span><em>{ProfileData.ViewCount}</em>&nbsp;&nbsp;<span>更新次数：</span><em>{PrData.UpdateTime}</em>&nbsp;&nbsp;<span>最近更新：</span><em>{PrData.UpdateDate.ToString("yyyy-MM-dd")}</em>
</td>
<td align="right">
<%if UserData.Id!=ProfileData.Id%>

<a href="javascript:if({UserData.Id}<=0) alert('请先登录！');else showMsgSendingDialog({ProfileData.Id});"><font color=Green>发送消息</font></a>&nbsp;|&nbsp;
<%csharp%>
int state=FriendBLL.Instance.CheckFriend(UserData.Id, ProfileData.Id);
if(state != Constants.FriendPass){
<%/csharp%>
        <a href="javascript:if({UserData.Id}<=0) alert('请先登录！');else showFriendRequestDialog('{ProfileData.Id}','{ProfileData.UserName}','{ProfileData.Avatar}');" ><font color=Green>加为好友</font></a>&nbsp;|&nbsp;
<%csharp%>}<%/csharp%>

<a href="javascript:if({UserData.Id}<=0) alert('请先登录！');else showActionSendingDialog({ProfileData.Id});"><font color=Green>发送互动</font></a>&nbsp;|&nbsp;
<a href="javascript:if({UserData.Id}<=0) alert('请先登录！');else _$('msg').focus();"><font color=Green>给我留言</font></a>
<%else%>
&nbsp;
<%/if%>

</td></tr>
</table>
</div>

         
<%if PrData.DiseaseId<=0%>
    <%if UserData.Id==ProfileData.Id%>
    <%csharp%>TempUrl = "/DiseaseHistory/Index.aspx"; <%/csharp%>
    <h2 style="padding:10px; text-align:center;">你还没有记录你的患病信息，<a href="{this.GetUrl(TempUrl)}" style="color:Green;">现在开始记录</a></h2>
    <%else%>
    <h2 style="padding:10px; text-align:center;">该用户还未添加患病信息</h2>
    <%/if%>
<%else%>
<%if PrData.DiseaseId==20%>
<%csharp%>TempUrl = ModuleCtrl.Header4("XiaoChuangraph","哮喘图表",true,false); <%/csharp%>
{TempUrl}

   <%if UserData.Id==ProfileData.Id%>
        <%csharp%>TempUrl = "/XiaoChuanHistory/Index.aspx"; <%/csharp%>
        <p style="text-align:right; padding:10px;"><a href ="{this.GetUrl(TempUrl)}" class="selectall">更新</a></p>
    <%/if%> 
        <div id="Div1" style="text-align:center;">
            <div id="xiaochuanchart1"></div>
            <script type="text/javascript" src="/support/swfobject/xiaochuan.js"></script>                                                 
                <script type="text/javascript">
                    var g_uid = getURLParam("uid");
                    var g_sXiaoChuanUrl = "/Pages/Alpha/XiaoChuanHistory/XiaoChuanHistory.aspx?uin=" + g_uid;
                    var g_vXiaoChuanFlash = "xiaochuanchart";
                    swfobject.embedSWF("/support/swfchart/open-flash-chart.swf", "xiaochuanchart1", "720", "250", "9.0.0", "expressInstall.swf", { 'id': '1', 'flashready': 'OnXiaoChuanFlashReady'},{wmode: "transparent"});
            </script>
        </div>
        
         <div class="time_tab">
         <span>按时间分段查看：</span>
            <table cellpadding="0" cellspacing="0" border="0"><tr>
                <td id="k_time_tab_1"><a href="javascript:showXiaoChuanFlashMode(1);changeRangeClass('k_time_tab_',1,5,1,'tab_over','');">三月</a></td>
                <td id="k_time_tab_2"><a href="javascript:showXiaoChuanFlashMode(2);changeRangeClass('k_time_tab_',1,5,2,'tab_over','');">六月</a></td>
                <td id="k_time_tab_3"><a href="javascript:showXiaoChuanFlashMode(3);changeRangeClass('k_time_tab_',1,5,3,'tab_over','');">一年</a></td>
                <td id="k_time_tab_4"><a href="javascript:showXiaoChuanFlashMode(4);changeRangeClass('k_time_tab_',1,5,4,'tab_over','');">三年</a></td>
                <td id="k_time_tab_5"><a href="javascript:showXiaoChuanFlashMode(0);changeRangeClass('k_time_tab_',1,5,5,'tab_over','');">所有</a></td>
                <td>
                 从
            <input class="box-var validate-date" id="dateXiaoChuanStart" maxlength="10" size="10" name="dateXiaoChuanStart" style="vertical-align:top;" value="2009-03-09" />
           
            到
            <input class="box-var validate-date" id="dateXiaoChuanEnd" maxlength="10" size="10" name="dateXiaoChuanEnd" style="vertical-align:top;" value="2009-03-09" />
           
                <input type=button id="Button4" value="查看"/ onclick="javascript:showXiaoChuanFlashMode(5,parseDate(_$('dateXiaoChuanEnd').value),parseDate(_$('dateXiaoChuanStart').value));"></td>
            </tr></table>
        </div>       
 <%csharp%>TempUrl = ModuleCtrl.Footer("XiaoChuangraph"); <%/csharp%>
 {TempUrl}
<%/if%>
<%csharp%>TempUrl = ModuleCtrl.Header4("Indicatorgraph","指标图表",true,false); <%/csharp%>
{TempUrl}
<script type="text/javascript" src="/support/My97DatePicker/WdatePicker.js"></script>
   <%if UserData.Id==ProfileData.Id%>
        <%csharp%>TempUrl = "/IndicatorHistory/Index.aspx"; <%/csharp%>
        <p style="text-align:right; padding:10px;"><a href ="{this.GetUrl(TempUrl)}" class="selectall">更新</a></p>
    <%/if%>
        <div id=indicatorchart>
            <div id="indicatorchart1"></div>
            <script type="text/javascript" src="/support/swfobject/indicatorhistory.js"></script>                                                 
                <script type="text/javascript">
                var g_uid=getURLParam("uid");
                var g_sUrl="/Pages/Alpha/IndicatorHistory/IndicatorHistory.aspx?uin="+g_uid;
                var g_chartwidth=720;
                var g_vIndicatorFlash="indicatorchart";
                swfobject.embedSWF("/support/swfchart/open-flash-chart.swf", "indicatorchart1", "720", "250","9.0.0", "expressInstall.swf",{'id':'1','flashready':'OnIndicatorFlashReady'},{wmode: "transparent"});
            </script>
        <br /><div id="indicatorchart2" style="display:none"></div>
        <br /><div id="indicatorchart3" style="display:none"></div>
        </div>
                
         <div class="time_tab">
         <span>按时间分段查看：</span>
            <table cellpadding="0" cellspacing="0" border="0"><tr>
            <td id="i_time_tab_1"><a href="javascript:showIndicatorFlashMode(1);changeRangeClass('i_time_tab_',1,5,1,'tab_over','');">三月</a></td>
            
            <td id="i_time_tab_2"><a href="javascript:showIndicatorFlashMode(2);changeRangeClass('i_time_tab_',1,5,2,'tab_over','');">六月</a></td>
           
            <td id="i_time_tab_3"><a href="javascript:showIndicatorFlashMode(3);changeRangeClass('i_time_tab_',1,5,3,'tab_over','');">一年</a></td>
            
            <td id="i_time_tab_4"><a href="javascript:showIndicatorFlashMode(4);changeRangeClass('i_time_tab_',1,5,4,'tab_over','');">三年</a></td>
           
            <td id="i_time_tab_5"><a href="javascript:showIndicatorFlashMode(0);changeRangeClass('i_time_tab_',1,5,5,'tab_over','');">所有</a></td>
            <td>
从

            <input class="box-var validate-date" id="dateIndicatorStart" maxlength="10" size="10" name="dateIndicatorStart" style="vertical-align:top;"
                value="2009-03-09" />
    到

            <input class="box-var validate-date" id="dateIndicatorEnd" maxlength="10" size="10" name="dateIndicatorEnd" style="vertical-align:top;"
                value='{DateTime.Today.ToString("yyyy-MM-dd")}' />
            <input type=button id="btnShowIndicatorData" value="查看"/ onclick="javascript:showIndicatorFlashMode(5,parseDate(_$('dateIndicatorEnd').value),parseDate(_$('dateIndicatorStart').value));"></li>
                     </td>
          </tr></table>
        </div>    
      
  <%csharp%>TempUrl = ModuleCtrl.Footer("Indicatorgraph"); <%/csharp%>
 {TempUrl}
        
 <%csharp%>TempUrl = ModuleCtrl.Header4("symptomgraph"," 症状图表",true,false); <%/csharp%>
{TempUrl}
     <%if UserData.Id==ProfileData.Id%>
        <%csharp%>TempUrl = "/SymptomHistory/Index.aspx"; <%/csharp%>
        <p style="text-align:right; padding:10px;"><a href ="{this.GetUrl(TempUrl)}" class="selectall">更新</a></p>
    <%/if%> 
               
    <div id="symptomdiv"  style="text-align:center;margin:0 auto"> 
        <p style="width:700px;text-align:left"><br />
            <b>主要症状：</b>YOUHP定制的该疾病最常见症状，它们直接反应病情变化；<br /><br />
        </p>           
        <div id="symptomchart1"></div>
            <script type="text/javascript" src="/support/swfobject/symptom.js"></script>                                                 
                <script type="text/javascript">
                var g_uid=getURLParam("uid");
                var g_sSymptomUrl="/Pages/Alpha/SymptomHistory/SymptomHistory.aspx?uin="+g_uid;
                var g_vSymptomFlash="symptomchart";
                swfobject.embedSWF("/support/swfchart/open-flash-chart.swf", "symptomchart1", "720", "250","9.0.0", "expressInstall.swf",{'id':'1','flashready':'OnSymptomFlashReady'},{wmode: "transparent"});
            </script>
     </div>
   
    <div class="time_tab">
    <span>按时间分段查看：</span>
        <table cellpadding="0" cellspacing="0" border="0"><tr>
            <td id="s_time_tab_1"><a href="javascript:showSymptomFlashMode(1);changeRangeClass('s_time_tab_',1,5,1,'tab_over','');">三月</a></td>
            <td id="s_time_tab_2"><a href="javascript:showSymptomFlashMode(2);changeRangeClass('s_time_tab_',1,5,2,'tab_over','');">六月</a></td>
            <td id="s_time_tab_3"><a href="javascript:showSymptomFlashMode(3);changeRangeClass('s_time_tab_',1,5,3,'tab_over','');">一年</a></td>
            <td id="s_time_tab_4"><a href="javascript:showSymptomFlashMode(4);changeRangeClass('s_time_tab_',1,5,4,'tab_over','');">三年</a></td>
            <td id="s_time_tab_5"><a href="javascript:showSymptomFlashMode(0);changeRangeClass('s_time_tab_',1,5,5,'tab_over','');">所有</a></td>
            <td> 从
            <input class="box-var validate-date" id="dateSymptomStart" maxlength="10" size="10" name="dateSymptomStart" style="vertical-align:top;"
                value="2009-03-09" />
            到
            <input class="box-var validate-date" id="dateSymptomEnd" maxlength="10" size="10" name="dateSymptomEnd" style="vertical-align:top;"
                value='{DateTime.Today.ToString("yyyy-MM-dd")}' />
           <input type=button id="Button1" value="查看"/ onclick="javascript:showIndicatorFlashMode(5,parseDate(_$('dateSymptomEnd').value),parseDate(_$('dateSymptomStart').value));"></td>
         
           </tr></table>
    </div>

 <%csharp%>TempUrl = ModuleCtrl.Footer("symptomgraph"); <%/csharp%>
 {TempUrl}
        
 <%csharp%>TempUrl = ModuleCtrl.Header4("treatmentgraph","治疗图表",true,false); <%/csharp%>
{TempUrl}

    <%if UserData.Id==ProfileData.Id%>
        <%csharp%>TempUrl = "/TreatmentHistory/Index.aspx"; <%/csharp%>
        <p style="text-align:right; padding:10px;"><a href ="{this.GetUrl(TempUrl)}" class="selectall">更新</a></p>
    <%/if%> 
        <div class="treatmentdiv" style="text-align:center;margin:0 auto">
                <div id="Treatmentchart1"></div>
                <script type="text/javascript">
                    var uin=getURLParam("uid");
                    var g_sTreatmentUrl="/Pages/Alpha/TreatmentHistory/TreatmentHistory.aspx?uin="+uin;
                    swfobject.embedSWF("/support/swfchart/open-flash-chart.swf", "Treatmentchart1", "720", "250","9.0.0", "expressInstall.swf",{'id':'1','flashready':'OnTreatmentFlashReady'},{wmode: "transparent"});
                </script>
                <script type="text/javascript" src="/support/swfobject/Treatment.js"></script>
            </div>
   
    <div class="time_tab">
    <span>按时间分段查看：</span>
       <table cellpadding="0" cellspacing="0" border="0"><tr>
            <td id="t_time_tab_1"><a href="javascript:showTreatmentFlashMode(1);changeRangeClass('t_time_tab_',1,5,1,'tab_over','');">三月</a></td>
            <td id="t_time_tab_2"><a href="javascript:showTreatmentFlashMode(2);changeRangeClass('t_time_tab_',1,5,2,'tab_over','');">六月</a></td>
            <td id="t_time_tab_3"><a href="javascript:showTreatmentFlashMode(3);changeRangeClass('t_time_tab_',1,5,3,'tab_over','');">一年</a></td>
            <td id="t_time_tab_4"><a href="javascript:showTreatmentFlashMode(4);changeRangeClass('t_time_tab_',1,5,4,'tab_over','');">三年</a></td>
            <td id="t_time_tab_5"><a href="javascript:showTreatmentFlashMode(0);changeRangeClass('t_time_tab_',1,5,5,'tab_over','');">所有</a></td>
            <td>从
            <input class="box-var validate-date" id="dateTreatmentStart" maxlength="10" size="10" name="dateTreatmentStart" style="vertical-align:top;"
                value="2009-03-09" />到
            <input class="box-var validate-date" id="dateTreatmentEnd" maxlength="10" size="10" name="dateTreatmentEnd" style="vertical-align:top;"
               value='{DateTime.Today.ToString("yyyy-MM-dd")}' />
            <input type=button id="Button3" value="查看"/ onclick="javascript:showTreatmentFlashMode(5,parseDate(_$('dateTreatmentEnd').value),parseDate(_$('dateTreatmentStart').value));"></td>
       </tr></table>
    </div>      
 <%csharp%>TempUrl = ModuleCtrl.Footer("treatmentgraph"); <%/csharp%>
 {TempUrl}
 
 <%csharp%>TempUrl = ModuleCtrl.Header4("Weightgraph","体重图表",true,false); <%/csharp%>
{TempUrl}

   <%if UserData.Id==ProfileData.Id%>
        <%csharp%>TempUrl = "/WeightHistory/Index.aspx"; <%/csharp%>
        <p style="text-align:right; padding:10px;"><a href ="{this.GetUrl(TempUrl)}" class="selectall">更新</a></p>
    <%/if%> 
        <div id="generaldiv" style="text-align:center;">
            <div id="weightchart1"></div>
            <script type="text/javascript" src="/support/swfobject/weight.js"></script>                                                 
                <script type="text/javascript">
                var g_uid=getURLParam("uid");
                var g_sWeightUrl="/Pages/Alpha/WeightHistory/WeightHistory.aspx?uin="+g_uid;
                var g_vWeightFlash="weightchart";
                swfobject.embedSWF("/support/swfchart/open-flash-chart.swf", "weightchart1", "720", "250", "9.0.0", "expressInstall.swf", { 'id': '1', 'flashready': 'OnWeightFlashReady' }, { wmode: "transparent" });
            </script>
        </div>
         <div class="time_tab">
         <span>按时间分段查看：</span>
            <table cellpadding="0" cellspacing="0" border="0"><tr>
                <td id="w_time_tab_1"><a href="javascript:showWeightFlashMode(1);changeRangeClass('w_time_tab_',1,5,1,'tab_over','');">三月</a></td>
                <td id="w_time_tab_2"><a href="javascript:showWeightFlashMode(2);changeRangeClass('w_time_tab_',1,5,2,'tab_over','');">六月</a></td>
                <td id="w_time_tab_3"><a href="javascript:showWeightFlashMode(3);changeRangeClass('w_time_tab_',1,5,3,'tab_over','');">一年</a></td>
                <td id="w_time_tab_4"><a href="javascript:showWeightFlashMode(4);changeRangeClass('w_time_tab_',1,5,4,'tab_over','');">三年</a></td>
                <td id="w_time_tab_5"><a href="javascript:showWeightFlashMode(0);changeRangeClass('w_time_tab_',1,5,5,'tab_over','');">所有</a></td>
                <td>
                 从
            <input class="box-var validate-date" id="dateWeightStart" maxlength="10" size="10" name="dateWeightStart" style="vertical-align:top;"
                value="2009-03-09" />
            到
            <input class="box-var validate-date" id="dateWeightEnd" maxlength="10" size="10" name="dateWeightEnd" style="vertical-align:top;"
                value='{DateTime.Today.ToString("yyyy-MM-dd")}' />
                <input type=button id="Button2" value="查看" onclick="javascript:showWeightFlashMode(5,parseDate(_$('dateWeightEnd').value),parseDate(_$('dateWeightStart').value));"></td>
            </tr></table>
        </div>       
 <%csharp%>TempUrl = ModuleCtrl.Footer("Weightgraph"); <%/csharp%>
 {TempUrl}
 
 <%/if%> 
 
 </div>
 
<script type="text/javascript" src="/support/Alpha/Js/profile/index.js"></script>
</div>
 <%csharp%>TempUrl = ModuleCtrl.Header4("commentpost","给"+ProfileData.UserName+"留言",false,false); <%/csharp%>
{TempUrl}
 
            <div class="content">
    
            <%csharp%>if(UserData.Id > 0) { <%/csharp%>

                    <div id="plshow">
                    <div class="bor"> 
                    <textarea name="msg" width="80%" cols="80" rows="6" id="msg" class="rev_textarea"></textarea>
                    <br /><font color="#808080">(字数请不要超过300个字)</font>
                    </div>
                    &nbsp;&nbsp;请文明参与讨论，禁止漫骂攻击。
                    <input name="sb" type="button" value="马上发表" class="" onClick="CommentAdd({ProfileData.Id});" />
                    </div>
                 <span id="cmtstate" style="color:Red"></span>
            
            <%csharp%> } else { <%/csharp%>
            <%csharp%>TempUrl = "/User/Login.aspx"; <%/csharp%>
            <b>我要说两句</b>.... (请在<a href="{this.GetUrl(TempUrl)}"><b style="text-decoration:underline; color:Red;">登录</b></a>后发表意见)
            <%csharp%> } <%/csharp%>
         
             </div>
 <%csharp%>TempUrl = ModuleCtrl.Footer("commentpost"); <%/csharp%>
 {TempUrl}
        

        
        <div class="box">

        <div class="pl"id="commentList">
   
                <div style="padding:20px 50px;">
                <%csharp%> TempUrl = "/images/indicator_medium.gif";<%/csharp%>
                <img src="{this.GetResource(TempUrl)}" /><b>正在加载评论……</b>
                
                </div>
        </div>     
        </div>


</div>
<script type="text/javascript">
function loadComments ()
{
  var uid=getURLParam("uid", location.href);
  var aurl = "/Pages/alpha/Ajax/CommentListAjax.aspx?uid="+uid+"&page=1";
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("commentList").innerHTML=html;
      }
   }
   );
   myAjax.request();
}  

function ViewCommentPage(pageindex)
{
  var query = location.href.substring(location.href.indexOf("?"));
  var aurl = "/Pages/alpha/Ajax/CommentListAjax.aspx"+query+"&page="+pageindex;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("commentList").innerHTML=html;
      }
   }
   );
   myAjax.request();
} 


 
function CommentDelete(id)
{
  var query = location.href.substring(location.href.indexOf("?"));
  var aurl = "/Pages/alpha/Ajax/CommentDeleteAjax.aspx"+query+"&id="+id;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("commentList").innerHTML=html;
      }
   }
   );
   myAjax.request();
  
  
} 


function CommentAdd(toUserId)
{
    var query = location.href.substring(location.href.indexOf("?"));
    var msg = _$("msg").value;
  
    if (msg.length == 0)
    {
        alert("评论内容不能为空！");
        return;
    }
    if(msg.length > 300 ) 
    {
        alert("评论内容不能超过300个字！");
        return;
    }
  var query = location.href.substring(location.href.indexOf("?"));
  var aurl = "/Pages/alpha/Ajax/CommentAddAjax.aspx"+query+"&msg="+msg.escUrl()+"&toUserId="+toUserId;
  var myAjax=new Ajax(aurl,
  {
     method:'post',
     onComplete:function()
     {
              var html=this.response.text;
              _$("commentList").innerHTML=html;
              _$("msg").value="";
      }
   }
   );
   myAjax.request();
  
  
}


function CommentReplyAdd(id,parentId,toUserId)
{
    var query = location.href.substring(location.href.indexOf("?"));
    var replycontent = _$("replycontent"+id).value;
      
        if (replycontent.length == 0)
        {
            alert("回复内容不能为空！");
            return;
        }
        if(replycontent.length > 300 ) 
        {
            alert("回复内容不能超过300个字！");
            return;
        }
      
      var aurl = "/Pages/alpha/Ajax/CommentReplyAddAjax.aspx"+query+"&replycontent="+replycontent.escUrl()+"&toUserId="+toUserId+"&parentId="+parentId;
      var myAjax=new Ajax(aurl,
      {
         method:'get',
         onComplete:function()
         {
           var html=this.response.text;
           _$("commentList").innerHTML=html;
           _$('replycontent'+id).value = "";
           _$('replybox'+id).style.display = 'none';
          }
       }
       );
       myAjax.request();
}

function replyadd(id)
{

      _$('replybox'+id).style.display = 'block';
}
function replycancell(id)
{

      _$('replybox'+id).style.display = 'none';
}

function displayReplyList(id)
{ 

      var e = _$('commentReplyList_'+id).style.display;
      if(e == 'none')
      {
        _$('commentReplyList_'+id).style.display = 'block';
        _$('displaySwitch_'+id).innerHTML = '-收缩';
      }
      else
      {
        _$('commentReplyList_'+id).style.display = 'none';
        _$('displaySwitch_'+id).innerHTML = '+展开';
      }
}

function changeRangeClass(prefix, start,end, inew, newclass, oldclass)
{
    for(var i=start;i<=end;++i) _$(prefix+i).className = i==inew ? newclass : oldclass ;
}
loadComments();
</script>
<!--<div id="BOX_overlay" style="background: #000; position: absolute; z-index:100; filter:alpha(opacity=50);-moz-opacity: 0.6;opacity: 0.6;"></div>-->
<div id="DIALOG"><iframe FRAMEBORDER=0 SCROLLING=NO ></iframe></div>
<script type="text/javascript" src="/support/Alpha/Js/float.js"></script>

<%template _footer%>
